package com.sc.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sc.dao.UserDao;
import com.sc.model.User;
import com.sc.service.UserService;

@Service
public class UserServiceImpl implements UserService{
	@Autowired
	private UserDao userDao;

	//注册
	@Override
	public void insertUser(User user) {
		userDao.insert(user);
	}

	//根据用户查询
	@Override
	public User findUserByName(String name) {
		return userDao.findUserByName(name);
	}

	//登录判断
	@Override
	public User findUserByNamePwd(String name, String password) {
		return userDao.findUserByNamePwd(name, password);
	}

	//修改信息
	@Override
	public void updateUser(User user) {
		userDao.updateById(user);
	}
	
	
}
